<?php

class SearchBox extends CWidget
{
	public $searchWord = '';
	
	static $show = false;
	
	static function show()
	{
		self::$show = true;
	}
	
	public function run()
	{
		if (array_key_exists('searchWord', $_POST) && strval($_POST['searchWord']) != '') {
			$this->searchWord = $_POST['searchWord']; 
		}
		
		$this->render('searchBox', array(
			'searchWord' => $this->searchWord,
			'showSearchBlock' => self::$show
		));
	}
	
}